(0) Obligation:

The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(1, n^2).


The TRS R consists of the following rules:

-(x, 0) → x
-(s(x), s(y)) → -(x, y)
p(s(x)) → x
f(s(x), y) → f(p(-(s(x), y)), p(-(y, s(x))))
f(x, s(y)) → f(p(-(x, s(y))), p(-(s(y), x)))

Rewrite Strategy: INNERMOST

(1) TrsToWeightedTrsProof (BOTH BOUNDS(ID, ID) transformation)

Transformed TRS to weighted TRS

(2) Obligation:

The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^2).


The TRS R consists of the following rules:

-(x, 0) → x [1]
-(s(x), s(y)) → -(x, y) [1]
p(s(x)) → x [1]
f(s(x), y) → f(p(-(s(x), y)), p(-(y, s(x)))) [1]
f(x, s(y)) → f(p(-(x, s(y))), p(-(s(y), x))) [1]

Rewrite Strategy: INNERMOST

(3) CpxWeightedTrsRenamingProof (BOTH BOUNDS(ID, ID) transformation)

Renamed defined symbols to avoid conflicts with arithmetic symbols:

- => minus

(4) Obligation:

The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^2).


The TRS R consists of the following rules:

minus(x, 0) → x [1]
minus(s(x), s(y)) → minus(x, y) [1]
p(s(x)) → x [1]
f(s(x), y) → f(p(minus(s(x), y)), p(minus(y, s(x)))) [1]
f(x, s(y)) → f(p(minus(x, s(y))), p(minus(s(y), x))) [1]

Rewrite Strategy: INNERMOST

(5) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)

Infered types.

(6) Obligation:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

minus(x, 0) → x [1]
minus(s(x), s(y)) → minus(x, y) [1]
p(s(x)) → x [1]
f(s(x), y) → f(p(minus(s(x), y)), p(minus(y, s(x)))) [1]
f(x, s(y)) → f(p(minus(x, s(y))), p(minus(s(y), x))) [1]

The TRS has the following type information:
minus :: 0:s → 0:s → 0:s
0 :: 0:s
s :: 0:s → 0:s
p :: 0:s → 0:s
f :: 0:s → 0:s → f

Rewrite Strategy: INNERMOST

(7) CompletionProof (UPPER BOUND(ID) transformation)

The transformation into a RNTS is sound, since:

(a) The obligation is a constructor system where every type has a constant constructor,

(b) The following defined symbols do not have to be completely defined, as they can never occur inside other defined symbols:


f

(c) The following functions are completely defined:

p
minus

Due to the following rules being added:

p(v0) → 0 [0]
minus(v0, v1) → 0 [0]

And the following fresh constants:

const

(8) Obligation:

Runtime Complexity Weighted TRS where critical functions are completely defined. The underlying TRS is:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

minus(x, 0) → x [1]
minus(s(x), s(y)) → minus(x, y) [1]
p(s(x)) → x [1]
f(s(x), y) → f(p(minus(s(x), y)), p(minus(y, s(x)))) [1]
f(x, s(y)) → f(p(minus(x, s(y))), p(minus(s(y), x))) [1]
p(v0) → 0 [0]
minus(v0, v1) → 0 [0]

The TRS has the following type information:
minus :: 0:s → 0:s → 0:s
0 :: 0:s
s :: 0:s → 0:s
p :: 0:s → 0:s
f :: 0:s → 0:s → f
const :: f

Rewrite Strategy: INNERMOST

(9) NarrowingProof (BOTH BOUNDS(ID, ID) transformation)

Narrowed the inner basic terms of all right-hand sides by a single narrowing step.

(10) Obligation:

Runtime Complexity Weighted TRS where critical functions are completely defined. The underlying TRS is:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

minus(x, 0) → x [1]
minus(s(x), s(y)) → minus(x, y) [1]
p(s(x)) → x [1]
f(s(x), 0) → f(p(s(x)), p(0)) [2]
f(s(x), s(y')) → f(p(minus(x, y')), p(minus(y', x))) [3]
f(s(x), s(y')) → f(p(minus(x, y')), p(0)) [2]
f(s(x), s(x')) → f(p(0), p(minus(x', x))) [2]
f(s(x), y) → f(p(0), p(0)) [1]
f(s(x''), s(y)) → f(p(minus(x'', y)), p(minus(y, x''))) [3]
f(s(x''), s(y)) → f(p(minus(x'', y)), p(0)) [2]
f(0, s(y)) → f(p(0), p(s(y))) [2]
f(s(y''), s(y)) → f(p(0), p(minus(y, y''))) [2]
f(x, s(y)) → f(p(0), p(0)) [1]
p(v0) → 0 [0]
minus(v0, v1) → 0 [0]

The TRS has the following type information:
minus :: 0:s → 0:s → 0:s
0 :: 0:s
s :: 0:s → 0:s
p :: 0:s → 0:s
f :: 0:s → 0:s → f
const :: f

Rewrite Strategy: INNERMOST

(11) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID) transformation)

Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction.
The constant constructors are abstracted as follows:

0 => 0
const => 0

(12) Obligation:

Complexity RNTS consisting of the following rules:

f(z, z') -{ 3 }→ f(p(minus(x, y')), p(minus(y', x))) :|: x >= 0, y' >= 0, z = 1 + x, z' = 1 + y'
f(z, z') -{ 2 }→ f(p(minus(x, y')), p(0)) :|: x >= 0, y' >= 0, z = 1 + x, z' = 1 + y'
f(z, z') -{ 3 }→ f(p(minus(x'', y)), p(minus(y, x''))) :|: z = 1 + x'', z' = 1 + y, y >= 0, x'' >= 0
f(z, z') -{ 2 }→ f(p(minus(x'', y)), p(0)) :|: z = 1 + x'', z' = 1 + y, y >= 0, x'' >= 0
f(z, z') -{ 2 }→ f(p(0), p(minus(x', x))) :|: z' = 1 + x', x >= 0, x' >= 0, z = 1 + x
f(z, z') -{ 2 }→ f(p(0), p(minus(y, y''))) :|: z' = 1 + y, z = 1 + y'', y >= 0, y'' >= 0
f(z, z') -{ 1 }→ f(p(0), p(0)) :|: x >= 0, y >= 0, z = 1 + x, z' = y
f(z, z') -{ 1 }→ f(p(0), p(0)) :|: z' = 1 + y, x >= 0, y >= 0, z = x
f(z, z') -{ 2 }→ f(p(0), p(1 + y)) :|: z' = 1 + y, y >= 0, z = 0
f(z, z') -{ 2 }→ f(p(1 + x), p(0)) :|: x >= 0, z = 1 + x, z' = 0
minus(z, z') -{ 1 }→ x :|: x >= 0, z = x, z' = 0
minus(z, z') -{ 1 }→ minus(x, y) :|: z' = 1 + y, x >= 0, y >= 0, z = 1 + x
minus(z, z') -{ 0 }→ 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1
p(z) -{ 1 }→ x :|: x >= 0, z = 1 + x
p(z) -{ 0 }→ 0 :|: v0 >= 0, z = v0

(13) InliningProof (UPPER BOUND(ID) transformation)

Inlined the following terminating rules on right-hand sides where appropriate:

p(z) -{ 1 }→ x :|: x >= 0, z = 1 + x
p(z) -{ 0 }→ 0 :|: v0 >= 0, z = v0

(14) Obligation:

Complexity RNTS consisting of the following rules:

f(z, z') -{ 3 }→ f(x', 0) :|: x >= 0, z = 1 + x, z' = 0, x' >= 0, 1 + x = 1 + x', v0 >= 0, 0 = v0
f(z, z') -{ 3 }→ f(p(minus(x, y')), p(minus(y', x))) :|: x >= 0, y' >= 0, z = 1 + x, z' = 1 + y'
f(z, z') -{ 2 }→ f(p(minus(x, y')), 0) :|: x >= 0, y' >= 0, z = 1 + x, z' = 1 + y', v0 >= 0, 0 = v0
f(z, z') -{ 3 }→ f(p(minus(x'', y)), p(minus(y, x''))) :|: z = 1 + x'', z' = 1 + y, y >= 0, x'' >= 0
f(z, z') -{ 2 }→ f(p(minus(x'', y)), 0) :|: z = 1 + x'', z' = 1 + y, y >= 0, x'' >= 0, v0 >= 0, 0 = v0
f(z, z') -{ 3 }→ f(0, x) :|: z' = 1 + y, y >= 0, z = 0, v0 >= 0, 0 = v0, x >= 0, 1 + y = 1 + x
f(z, z') -{ 2 }→ f(0, p(minus(x', x))) :|: z' = 1 + x', x >= 0, x' >= 0, z = 1 + x, v0 >= 0, 0 = v0
f(z, z') -{ 2 }→ f(0, p(minus(y, y''))) :|: z' = 1 + y, z = 1 + y'', y >= 0, y'' >= 0, v0 >= 0, 0 = v0
f(z, z') -{ 2 }→ f(0, 0) :|: x >= 0, z = 1 + x, z' = 0, v0 >= 0, 1 + x = v0, v0' >= 0, 0 = v0'
f(z, z') -{ 1 }→ f(0, 0) :|: x >= 0, y >= 0, z = 1 + x, z' = y, v0 >= 0, 0 = v0, v0' >= 0, 0 = v0'
f(z, z') -{ 2 }→ f(0, 0) :|: z' = 1 + y, y >= 0, z = 0, v0 >= 0, 0 = v0, v0' >= 0, 1 + y = v0'
f(z, z') -{ 1 }→ f(0, 0) :|: z' = 1 + y, x >= 0, y >= 0, z = x, v0 >= 0, 0 = v0, v0' >= 0, 0 = v0'
minus(z, z') -{ 1 }→ x :|: x >= 0, z = x, z' = 0
minus(z, z') -{ 1 }→ minus(x, y) :|: z' = 1 + y, x >= 0, y >= 0, z = 1 + x
minus(z, z') -{ 0 }→ 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1
p(z) -{ 1 }→ x :|: x >= 0, z = 1 + x
p(z) -{ 0 }→ 0 :|: v0 >= 0, z = v0

(15) SimplificationProof (BOTH BOUNDS(ID, ID) transformation)

Simplified the RNTS by moving equalities from the constraints into the right-hand sides.

(16) Obligation:

Complexity RNTS consisting of the following rules:

f(z, z') -{ 3 }→ f(x', 0) :|: z - 1 >= 0, z' = 0, x' >= 0, 1 + (z - 1) = 1 + x', v0 >= 0, 0 = v0
f(z, z') -{ 3 }→ f(p(minus(z - 1, z' - 1)), p(minus(z' - 1, z - 1))) :|: z - 1 >= 0, z' - 1 >= 0
f(z, z') -{ 2 }→ f(p(minus(z - 1, z' - 1)), 0) :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 0 = v0
f(z, z') -{ 3 }→ f(0, x) :|: z' - 1 >= 0, z = 0, v0 >= 0, 0 = v0, x >= 0, 1 + (z' - 1) = 1 + x
f(z, z') -{ 2 }→ f(0, p(minus(z' - 1, z - 1))) :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 0 = v0
f(z, z') -{ 2 }→ f(0, 0) :|: z - 1 >= 0, z' = 0, v0 >= 0, 1 + (z - 1) = v0, v0' >= 0, 0 = v0'
f(z, z') -{ 1 }→ f(0, 0) :|: z - 1 >= 0, z' >= 0, v0 >= 0, 0 = v0, v0' >= 0, 0 = v0'
f(z, z') -{ 2 }→ f(0, 0) :|: z' - 1 >= 0, z = 0, v0 >= 0, 0 = v0, v0' >= 0, 1 + (z' - 1) = v0'
f(z, z') -{ 1 }→ f(0, 0) :|: z >= 0, z' - 1 >= 0, v0 >= 0, 0 = v0, v0' >= 0, 0 = v0'
minus(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
minus(z, z') -{ 1 }→ minus(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0
minus(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
p(z) -{ 0 }→ 0 :|: z >= 0
p(z) -{ 1 }→ z - 1 :|: z - 1 >= 0

(17) CpxRntsAnalysisOrderProof (BOTH BOUNDS(ID, ID) transformation)

Found the following analysis order by SCC decomposition:

{ minus }
{ p }
{ f }

(18) Obligation:

Complexity RNTS consisting of the following rules:

f(z, z') -{ 3 }→ f(x', 0) :|: z - 1 >= 0, z' = 0, x' >= 0, 1 + (z - 1) = 1 + x', v0 >= 0, 0 = v0
f(z, z') -{ 3 }→ f(p(minus(z - 1, z' - 1)), p(minus(z' - 1, z - 1))) :|: z - 1 >= 0, z' - 1 >= 0
f(z, z') -{ 2 }→ f(p(minus(z - 1, z' - 1)), 0) :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 0 = v0
f(z, z') -{ 3 }→ f(0, x) :|: z' - 1 >= 0, z = 0, v0 >= 0, 0 = v0, x >= 0, 1 + (z' - 1) = 1 + x
f(z, z') -{ 2 }→ f(0, p(minus(z' - 1, z - 1))) :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 0 = v0
f(z, z') -{ 2 }→ f(0, 0) :|: z - 1 >= 0, z' = 0, v0 >= 0, 1 + (z - 1) = v0, v0' >= 0, 0 = v0'
f(z, z') -{ 1 }→ f(0, 0) :|: z - 1 >= 0, z' >= 0, v0 >= 0, 0 = v0, v0' >= 0, 0 = v0'
f(z, z') -{ 2 }→ f(0, 0) :|: z' - 1 >= 0, z = 0, v0 >= 0, 0 = v0, v0' >= 0, 1 + (z' - 1) = v0'
f(z, z') -{ 1 }→ f(0, 0) :|: z >= 0, z' - 1 >= 0, v0 >= 0, 0 = v0, v0' >= 0, 0 = v0'
minus(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
minus(z, z') -{ 1 }→ minus(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0
minus(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
p(z) -{ 0 }→ 0 :|: z >= 0
p(z) -{ 1 }→ z - 1 :|: z - 1 >= 0

Function symbols to be analyzed: {minus}, {p}, {f}

(19) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using KoAT for: minus
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: z

(20) Obligation:

Complexity RNTS consisting of the following rules:

f(z, z') -{ 3 }→ f(x', 0) :|: z - 1 >= 0, z' = 0, x' >= 0, 1 + (z - 1) = 1 + x', v0 >= 0, 0 = v0
f(z, z') -{ 3 }→ f(p(minus(z - 1, z' - 1)), p(minus(z' - 1, z - 1))) :|: z - 1 >= 0, z' - 1 >= 0
f(z, z') -{ 2 }→ f(p(minus(z - 1, z' - 1)), 0) :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 0 = v0
f(z, z') -{ 3 }→ f(0, x) :|: z' - 1 >= 0, z = 0, v0 >= 0, 0 = v0, x >= 0, 1 + (z' - 1) = 1 + x
f(z, z') -{ 2 }→ f(0, p(minus(z' - 1, z - 1))) :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 0 = v0
f(z, z') -{ 2 }→ f(0, 0) :|: z - 1 >= 0, z' = 0, v0 >= 0, 1 + (z - 1) = v0, v0' >= 0, 0 = v0'
f(z, z') -{ 1 }→ f(0, 0) :|: z - 1 >= 0, z' >= 0, v0 >= 0, 0 = v0, v0' >= 0, 0 = v0'
f(z, z') -{ 2 }→ f(0, 0) :|: z' - 1 >= 0, z = 0, v0 >= 0, 0 = v0, v0' >= 0, 1 + (z' - 1) = v0'
f(z, z') -{ 1 }→ f(0, 0) :|: z >= 0, z' - 1 >= 0, v0 >= 0, 0 = v0, v0' >= 0, 0 = v0'
minus(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
minus(z, z') -{ 1 }→ minus(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0
minus(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
p(z) -{ 0 }→ 0 :|: z >= 0
p(z) -{ 1 }→ z - 1 :|: z - 1 >= 0

Function symbols to be analyzed: {minus}, {p}, {f}
Previous analysis results are:
minus: runtime: ?, size: O(n1) [z]

(21) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using CoFloCo for: minus
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 1 + z'

(22) Obligation:

Complexity RNTS consisting of the following rules:

f(z, z') -{ 3 }→ f(x', 0) :|: z - 1 >= 0, z' = 0, x' >= 0, 1 + (z - 1) = 1 + x', v0 >= 0, 0 = v0
f(z, z') -{ 3 }→ f(p(minus(z - 1, z' - 1)), p(minus(z' - 1, z - 1))) :|: z - 1 >= 0, z' - 1 >= 0
f(z, z') -{ 2 }→ f(p(minus(z - 1, z' - 1)), 0) :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 0 = v0
f(z, z') -{ 3 }→ f(0, x) :|: z' - 1 >= 0, z = 0, v0 >= 0, 0 = v0, x >= 0, 1 + (z' - 1) = 1 + x
f(z, z') -{ 2 }→ f(0, p(minus(z' - 1, z - 1))) :|: z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 0 = v0
f(z, z') -{ 2 }→ f(0, 0) :|: z - 1 >= 0, z' = 0, v0 >= 0, 1 + (z - 1) = v0, v0' >= 0, 0 = v0'
f(z, z') -{ 1 }→ f(0, 0) :|: z - 1 >= 0, z' >= 0, v0 >= 0, 0 = v0, v0' >= 0, 0 = v0'
f(z, z') -{ 2 }→ f(0, 0) :|: z' - 1 >= 0, z = 0, v0 >= 0, 0 = v0, v0' >= 0, 1 + (z' - 1) = v0'
f(z, z') -{ 1 }→ f(0, 0) :|: z >= 0, z' - 1 >= 0, v0 >= 0, 0 = v0, v0' >= 0, 0 = v0'
minus(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
minus(z, z') -{ 1 }→ minus(z - 1, z' - 1) :|: z - 1 >= 0, z' - 1 >= 0
minus(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
p(z) -{ 0 }→ 0 :|: z >= 0
p(z) -{ 1 }→ z - 1 :|: z - 1 >= 0

Function symbols to be analyzed: {p}, {f}
Previous analysis results are:
minus: runtime: O(n1) [1 + z'], size: O(n1) [z]

(23) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(24) Obligation:

Complexity RNTS consisting of the following rules:

f(z, z') -{ 3 }→ f(x', 0) :|: z - 1 >= 0, z' = 0, x' >= 0, 1 + (z - 1) = 1 + x', v0 >= 0, 0 = v0
f(z, z') -{ 3 + z + z' }→ f(p(s'), p(s'')) :|: s' >= 0, s' <= 1 * (z - 1), s'' >= 0, s'' <= 1 * (z' - 1), z - 1 >= 0, z' - 1 >= 0
f(z, z') -{ 2 + z' }→ f(p(s1), 0) :|: s1 >= 0, s1 <= 1 * (z - 1), z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 0 = v0
f(z, z') -{ 3 }→ f(0, x) :|: z' - 1 >= 0, z = 0, v0 >= 0, 0 = v0, x >= 0, 1 + (z' - 1) = 1 + x
f(z, z') -{ 2 + z }→ f(0, p(s2)) :|: s2 >= 0, s2 <= 1 * (z' - 1), z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 0 = v0
f(z, z') -{ 2 }→ f(0, 0) :|: z - 1 >= 0, z' = 0, v0 >= 0, 1 + (z - 1) = v0, v0' >= 0, 0 = v0'
f(z, z') -{ 1 }→ f(0, 0) :|: z - 1 >= 0, z' >= 0, v0 >= 0, 0 = v0, v0' >= 0, 0 = v0'
f(z, z') -{ 2 }→ f(0, 0) :|: z' - 1 >= 0, z = 0, v0 >= 0, 0 = v0, v0' >= 0, 1 + (z' - 1) = v0'
f(z, z') -{ 1 }→ f(0, 0) :|: z >= 0, z' - 1 >= 0, v0 >= 0, 0 = v0, v0' >= 0, 0 = v0'
minus(z, z') -{ 1 + z' }→ s :|: s >= 0, s <= 1 * (z - 1), z - 1 >= 0, z' - 1 >= 0
minus(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
minus(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
p(z) -{ 0 }→ 0 :|: z >= 0
p(z) -{ 1 }→ z - 1 :|: z - 1 >= 0

Function symbols to be analyzed: {p}, {f}
Previous analysis results are:
minus: runtime: O(n1) [1 + z'], size: O(n1) [z]

(25) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using KoAT for: p
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: z

(26) Obligation:

Complexity RNTS consisting of the following rules:

f(z, z') -{ 3 }→ f(x', 0) :|: z - 1 >= 0, z' = 0, x' >= 0, 1 + (z - 1) = 1 + x', v0 >= 0, 0 = v0
f(z, z') -{ 3 + z + z' }→ f(p(s'), p(s'')) :|: s' >= 0, s' <= 1 * (z - 1), s'' >= 0, s'' <= 1 * (z' - 1), z - 1 >= 0, z' - 1 >= 0
f(z, z') -{ 2 + z' }→ f(p(s1), 0) :|: s1 >= 0, s1 <= 1 * (z - 1), z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 0 = v0
f(z, z') -{ 3 }→ f(0, x) :|: z' - 1 >= 0, z = 0, v0 >= 0, 0 = v0, x >= 0, 1 + (z' - 1) = 1 + x
f(z, z') -{ 2 + z }→ f(0, p(s2)) :|: s2 >= 0, s2 <= 1 * (z' - 1), z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 0 = v0
f(z, z') -{ 2 }→ f(0, 0) :|: z - 1 >= 0, z' = 0, v0 >= 0, 1 + (z - 1) = v0, v0' >= 0, 0 = v0'
f(z, z') -{ 1 }→ f(0, 0) :|: z - 1 >= 0, z' >= 0, v0 >= 0, 0 = v0, v0' >= 0, 0 = v0'
f(z, z') -{ 2 }→ f(0, 0) :|: z' - 1 >= 0, z = 0, v0 >= 0, 0 = v0, v0' >= 0, 1 + (z' - 1) = v0'
f(z, z') -{ 1 }→ f(0, 0) :|: z >= 0, z' - 1 >= 0, v0 >= 0, 0 = v0, v0' >= 0, 0 = v0'
minus(z, z') -{ 1 + z' }→ s :|: s >= 0, s <= 1 * (z - 1), z - 1 >= 0, z' - 1 >= 0
minus(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
minus(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
p(z) -{ 0 }→ 0 :|: z >= 0
p(z) -{ 1 }→ z - 1 :|: z - 1 >= 0

Function symbols to be analyzed: {p}, {f}
Previous analysis results are:
minus: runtime: O(n1) [1 + z'], size: O(n1) [z]
p: runtime: ?, size: O(n1) [z]

(27) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using CoFloCo for: p
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 1

(28) Obligation:

Complexity RNTS consisting of the following rules:

f(z, z') -{ 3 }→ f(x', 0) :|: z - 1 >= 0, z' = 0, x' >= 0, 1 + (z - 1) = 1 + x', v0 >= 0, 0 = v0
f(z, z') -{ 3 + z + z' }→ f(p(s'), p(s'')) :|: s' >= 0, s' <= 1 * (z - 1), s'' >= 0, s'' <= 1 * (z' - 1), z - 1 >= 0, z' - 1 >= 0
f(z, z') -{ 2 + z' }→ f(p(s1), 0) :|: s1 >= 0, s1 <= 1 * (z - 1), z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 0 = v0
f(z, z') -{ 3 }→ f(0, x) :|: z' - 1 >= 0, z = 0, v0 >= 0, 0 = v0, x >= 0, 1 + (z' - 1) = 1 + x
f(z, z') -{ 2 + z }→ f(0, p(s2)) :|: s2 >= 0, s2 <= 1 * (z' - 1), z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 0 = v0
f(z, z') -{ 2 }→ f(0, 0) :|: z - 1 >= 0, z' = 0, v0 >= 0, 1 + (z - 1) = v0, v0' >= 0, 0 = v0'
f(z, z') -{ 1 }→ f(0, 0) :|: z - 1 >= 0, z' >= 0, v0 >= 0, 0 = v0, v0' >= 0, 0 = v0'
f(z, z') -{ 2 }→ f(0, 0) :|: z' - 1 >= 0, z = 0, v0 >= 0, 0 = v0, v0' >= 0, 1 + (z' - 1) = v0'
f(z, z') -{ 1 }→ f(0, 0) :|: z >= 0, z' - 1 >= 0, v0 >= 0, 0 = v0, v0' >= 0, 0 = v0'
minus(z, z') -{ 1 + z' }→ s :|: s >= 0, s <= 1 * (z - 1), z - 1 >= 0, z' - 1 >= 0
minus(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
minus(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
p(z) -{ 0 }→ 0 :|: z >= 0
p(z) -{ 1 }→ z - 1 :|: z - 1 >= 0

Function symbols to be analyzed: {f}
Previous analysis results are:
minus: runtime: O(n1) [1 + z'], size: O(n1) [z]
p: runtime: O(1) [1], size: O(n1) [z]

(29) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(30) Obligation:

Complexity RNTS consisting of the following rules:

f(z, z') -{ 5 + z + z' }→ f(s3, s4) :|: s3 >= 0, s3 <= 1 * s', s4 >= 0, s4 <= 1 * s'', s' >= 0, s' <= 1 * (z - 1), s'' >= 0, s'' <= 1 * (z' - 1), z - 1 >= 0, z' - 1 >= 0
f(z, z') -{ 3 + z' }→ f(s5, 0) :|: s5 >= 0, s5 <= 1 * s1, s1 >= 0, s1 <= 1 * (z - 1), z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 0 = v0
f(z, z') -{ 3 }→ f(x', 0) :|: z - 1 >= 0, z' = 0, x' >= 0, 1 + (z - 1) = 1 + x', v0 >= 0, 0 = v0
f(z, z') -{ 3 + z }→ f(0, s6) :|: s6 >= 0, s6 <= 1 * s2, s2 >= 0, s2 <= 1 * (z' - 1), z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 0 = v0
f(z, z') -{ 3 }→ f(0, x) :|: z' - 1 >= 0, z = 0, v0 >= 0, 0 = v0, x >= 0, 1 + (z' - 1) = 1 + x
f(z, z') -{ 2 }→ f(0, 0) :|: z - 1 >= 0, z' = 0, v0 >= 0, 1 + (z - 1) = v0, v0' >= 0, 0 = v0'
f(z, z') -{ 1 }→ f(0, 0) :|: z - 1 >= 0, z' >= 0, v0 >= 0, 0 = v0, v0' >= 0, 0 = v0'
f(z, z') -{ 2 }→ f(0, 0) :|: z' - 1 >= 0, z = 0, v0 >= 0, 0 = v0, v0' >= 0, 1 + (z' - 1) = v0'
f(z, z') -{ 1 }→ f(0, 0) :|: z >= 0, z' - 1 >= 0, v0 >= 0, 0 = v0, v0' >= 0, 0 = v0'
minus(z, z') -{ 1 + z' }→ s :|: s >= 0, s <= 1 * (z - 1), z - 1 >= 0, z' - 1 >= 0
minus(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
minus(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
p(z) -{ 0 }→ 0 :|: z >= 0
p(z) -{ 1 }→ z - 1 :|: z - 1 >= 0

Function symbols to be analyzed: {f}
Previous analysis results are:
minus: runtime: O(n1) [1 + z'], size: O(n1) [z]
p: runtime: O(1) [1], size: O(n1) [z]

(31) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using CoFloCo for: f
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 0

(32) Obligation:

Complexity RNTS consisting of the following rules:

f(z, z') -{ 5 + z + z' }→ f(s3, s4) :|: s3 >= 0, s3 <= 1 * s', s4 >= 0, s4 <= 1 * s'', s' >= 0, s' <= 1 * (z - 1), s'' >= 0, s'' <= 1 * (z' - 1), z - 1 >= 0, z' - 1 >= 0
f(z, z') -{ 3 + z' }→ f(s5, 0) :|: s5 >= 0, s5 <= 1 * s1, s1 >= 0, s1 <= 1 * (z - 1), z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 0 = v0
f(z, z') -{ 3 }→ f(x', 0) :|: z - 1 >= 0, z' = 0, x' >= 0, 1 + (z - 1) = 1 + x', v0 >= 0, 0 = v0
f(z, z') -{ 3 + z }→ f(0, s6) :|: s6 >= 0, s6 <= 1 * s2, s2 >= 0, s2 <= 1 * (z' - 1), z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 0 = v0
f(z, z') -{ 3 }→ f(0, x) :|: z' - 1 >= 0, z = 0, v0 >= 0, 0 = v0, x >= 0, 1 + (z' - 1) = 1 + x
f(z, z') -{ 2 }→ f(0, 0) :|: z - 1 >= 0, z' = 0, v0 >= 0, 1 + (z - 1) = v0, v0' >= 0, 0 = v0'
f(z, z') -{ 1 }→ f(0, 0) :|: z - 1 >= 0, z' >= 0, v0 >= 0, 0 = v0, v0' >= 0, 0 = v0'
f(z, z') -{ 2 }→ f(0, 0) :|: z' - 1 >= 0, z = 0, v0 >= 0, 0 = v0, v0' >= 0, 1 + (z' - 1) = v0'
f(z, z') -{ 1 }→ f(0, 0) :|: z >= 0, z' - 1 >= 0, v0 >= 0, 0 = v0, v0' >= 0, 0 = v0'
minus(z, z') -{ 1 + z' }→ s :|: s >= 0, s <= 1 * (z - 1), z - 1 >= 0, z' - 1 >= 0
minus(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
minus(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
p(z) -{ 0 }→ 0 :|: z >= 0
p(z) -{ 1 }→ z - 1 :|: z - 1 >= 0

Function symbols to be analyzed: {f}
Previous analysis results are:
minus: runtime: O(n1) [1 + z'], size: O(n1) [z]
p: runtime: O(1) [1], size: O(n1) [z]
f: runtime: ?, size: O(1) [0]

(33) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using CoFloCo for: f
after applying outer abstraction to obtain an ITS,
resulting in: O(n2) with polynomial bound: 17 + 8·z + z·z' + z2 + 8·z' + z'2

(34) Obligation:

Complexity RNTS consisting of the following rules:

f(z, z') -{ 5 + z + z' }→ f(s3, s4) :|: s3 >= 0, s3 <= 1 * s', s4 >= 0, s4 <= 1 * s'', s' >= 0, s' <= 1 * (z - 1), s'' >= 0, s'' <= 1 * (z' - 1), z - 1 >= 0, z' - 1 >= 0
f(z, z') -{ 3 + z' }→ f(s5, 0) :|: s5 >= 0, s5 <= 1 * s1, s1 >= 0, s1 <= 1 * (z - 1), z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 0 = v0
f(z, z') -{ 3 }→ f(x', 0) :|: z - 1 >= 0, z' = 0, x' >= 0, 1 + (z - 1) = 1 + x', v0 >= 0, 0 = v0
f(z, z') -{ 3 + z }→ f(0, s6) :|: s6 >= 0, s6 <= 1 * s2, s2 >= 0, s2 <= 1 * (z' - 1), z - 1 >= 0, z' - 1 >= 0, v0 >= 0, 0 = v0
f(z, z') -{ 3 }→ f(0, x) :|: z' - 1 >= 0, z = 0, v0 >= 0, 0 = v0, x >= 0, 1 + (z' - 1) = 1 + x
f(z, z') -{ 2 }→ f(0, 0) :|: z - 1 >= 0, z' = 0, v0 >= 0, 1 + (z - 1) = v0, v0' >= 0, 0 = v0'
f(z, z') -{ 1 }→ f(0, 0) :|: z - 1 >= 0, z' >= 0, v0 >= 0, 0 = v0, v0' >= 0, 0 = v0'
f(z, z') -{ 2 }→ f(0, 0) :|: z' - 1 >= 0, z = 0, v0 >= 0, 0 = v0, v0' >= 0, 1 + (z' - 1) = v0'
f(z, z') -{ 1 }→ f(0, 0) :|: z >= 0, z' - 1 >= 0, v0 >= 0, 0 = v0, v0' >= 0, 0 = v0'
minus(z, z') -{ 1 + z' }→ s :|: s >= 0, s <= 1 * (z - 1), z - 1 >= 0, z' - 1 >= 0
minus(z, z') -{ 1 }→ z :|: z >= 0, z' = 0
minus(z, z') -{ 0 }→ 0 :|: z >= 0, z' >= 0
p(z) -{ 0 }→ 0 :|: z >= 0
p(z) -{ 1 }→ z - 1 :|: z - 1 >= 0

Function symbols to be analyzed:
Previous analysis results are:
minus: runtime: O(n1) [1 + z'], size: O(n1) [z]
p: runtime: O(1) [1], size: O(n1) [z]
f: runtime: O(n2) [17 + 8·z + z·z' + z2 + 8·z' + z'2], size: O(1) [0]

(35) FinalProof (EQUIVALENT transformation)

Computed overall runtime complexity

(36) BOUNDS(1, n^2)